fix(viewerAction): replace the history entry when closing the viewer - #3331
Open
ELHart05 wants to merge 2 commits into
Open
fix(viewerAction): replace the history entry when closing the viewer#3331ELHart05 wants to merge 2 commits into
ELHart05 wants to merge 2 commits into
Conversation
Opening a file replaces the folder's history entry with one that carries `openfile`. Closing pushed a new entry on top of it instead of replacing it, so the entry carrying `openfile` was left behind: going back after closing reopened the file that had just been closed instead of leaving the folder, and further back navigation bounced between the leftover entries. Closing now replaces the current entry, mirroring what opening does. Signed-off-by: ELHart05 <o.allaoua@esi-sba.dz>
ELHart05
force-pushed
the
fix/viewer-close-history-entry
branch
from
August 12, 2026 16:12
bf0051a to
3cc0d2e
Compare
Signed-off-by: ELHart05 <o.allaoua@esi-sba.dz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pushToHistoryopens a file by replacing the folder's history entry with one that carriesopenfile, butonClosepushes a new entry instead of replacing it. The entry carryingopenfileis left behind, so after closing a file, going back reopens the file you just closed rather than leaving the folder. Pressing back again bounces between the leftoverediting=falseentries, because the viewer keeps pushing while you are navigating backwards.Steps, on 34.0.2:
Expected: you leave the folder. Actual: the viewer reopens.
Closing now replaces the current entry, which mirrors what opening does and leaves the history exactly as it was before the file was opened.
Added a case to
playwright/e2e/navigation.spec.tsnext to the existing back-button test. It fails without the change.Needs
/compilebefore merging.